-- Decompiled with the Synapse X Luau decompiler.

local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script);
M.ui_list = {};
local LocalPlayer = game:GetService("Players").LocalPlayer;
local pairs = pairs;
local gGuiWillShowing={}
local gNextConn=nil
function M.InstallUIList(self)
	self.PlayerGui = ClientOHOH:GetPath_Loop("PlayerGui", LocalPlayer);
	for id, ui_calss in pairs((ClientOHOH.load.UIList())) do
		self:CreateUI(id,ui_calss)
	end;

end;

function M.CreateUI(self,id,ui_class,...)
	local ui = ui_class.new(...);
	ui:SetParentInstance(self.PlayerGui);
	self.ui_list[id] = ui;
	return ui
end

function M.PushShow(self,id)
	local gui=self.ui_list[id]
	assert(gui,"PushShow Error-->:"..id)
	table.insert(gGuiWillShowing,gui)
	if not gNextConn then
		M.ShowNextGui()
	end
end


function M.ShowNextGui(self)
	if gNextConn  then
		gNextConn:Disconnect()
		gNextConn=nil
	end
	if #gGuiWillShowing>0 then
		local gui=gGuiWillShowing[1]
		table.remove(gGuiWillShowing,1)
		gui:Show()
		gNextConn=gui.BaseHideEvent:Connect(function()
			task.wait(1)
			M.ShowNextGui()
		end)
	end
end

--function M.IsMobile(self)
--	if  self.TouchGui then
--		return true
--	end
--	return false
--end

--function M.GetMobileTouchGui(self)
--	return self.TouchGui
--end

return M;
